package com.springtest.demo.dao.implement;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.springtest.demo.dao.BaseDao;
import com.springtest.demo.dao.TeacherDao;
import com.springtest.demo.model.ResultEntity;
import com.springtest.demo.model.Teacher;

@Repository("teacherDao")
public class TeacherDaoImpl extends BaseDao implements TeacherDao{

	public int save(Teacher t) {
		return add(t);
	}

	public Teacher update(Teacher t) {
		super.update(t);
		return null;
	}

	public Teacher delete(Teacher t) {
		super.delete(t);
		return null;
	}

	public ResultEntity delete( int id) {
		super.delete(Teacher.class, id);
		return null;
	}

	public Teacher findById(int id) {
		return (Teacher) super.findById(Teacher.class, id);
	}

	public List<Teacher> findAll() {
		List<Teacher> l = super.findAll(Teacher.class);
		return l;
	}

}
